
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpGcmMsgpurview.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpGcmMsgpurviewForm"
 */
public class CcpGcmMsgpurviewForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _purviewGuid = null;
   private java.lang.String _typeCode = null;
   private java.lang.String _orgorusrGuid = null;
   private java.lang.String _purviewType = null;
   private java.lang.String _msgorcatGuid = null;
   private java.lang.String _readFlag = null;
   private java.lang.String _reserved1 = null;
   private java.lang.String _reserved2 = null;
   private java.lang.String _reserved3 = null;

   /**
    * Standard constructor.
    */
   public CcpGcmMsgpurviewForm() {
   }

   /**
    * Returns the purviewGuid
    *
    * @return the purviewGuid
    */
   public java.lang.String getPurviewGuid() {
      return _purviewGuid;
   }

   /**
    * Sets the purviewGuid
    *
    * @param purviewGuid the new purviewGuid value
    */
   public void setPurviewGuid(java.lang.String purviewGuid) {
      _purviewGuid = purviewGuid;
   }
   /**
    * Returns the typeCode
    *
    * @return the typeCode
    */
   public java.lang.String getTypeCode() {
      return _typeCode;
   }

   /**
    * Sets the typeCode
    *
    * @param typeCode the new typeCode value
    */
   public void setTypeCode(java.lang.String typeCode) {
      _typeCode = typeCode;
   }
   /**
    * Returns the orgorusrGuid
    *
    * @return the orgorusrGuid
    */
   public java.lang.String getOrgorusrGuid() {
      return _orgorusrGuid;
   }

   /**
    * Sets the orgorusrGuid
    *
    * @param orgorusrGuid the new orgorusrGuid value
    */
   public void setOrgorusrGuid(java.lang.String orgorusrGuid) {
      _orgorusrGuid = orgorusrGuid;
   }
   /**
    * Returns the purviewType
    *
    * @return the purviewType
    */
   public java.lang.String getPurviewType() {
      return _purviewType;
   }

   /**
    * Sets the purviewType
    *
    * @param purviewType the new purviewType value
    */
   public void setPurviewType(java.lang.String purviewType) {
      _purviewType = purviewType;
   }
   /**
    * Returns the msgorcatGuid
    *
    * @return the msgorcatGuid
    */
   public java.lang.String getMsgorcatGuid() {
      return _msgorcatGuid;
   }

   /**
    * Sets the msgorcatGuid
    *
    * @param msgorcatGuid the new msgorcatGuid value
    */
   public void setMsgorcatGuid(java.lang.String msgorcatGuid) {
      _msgorcatGuid = msgorcatGuid;
   }
   /**
    * Returns the readFlag
    *
    * @return the readFlag
    */
   public java.lang.String getReadFlag() {
      return _readFlag;
   }

   /**
    * Sets the readFlag
    *
    * @param readFlag the new readFlag value
    */
   public void setReadFlag(java.lang.String readFlag) {
      _readFlag = readFlag;
   }
   /**
    * Returns the reserved1
    *
    * @return the reserved1
    */
   public java.lang.String getReserved1() {
      return _reserved1;
   }

   /**
    * Sets the reserved1
    *
    * @param reserved1 the new reserved1 value
    */
   public void setReserved1(java.lang.String reserved1) {
      _reserved1 = reserved1;
   }
   /**
    * Returns the reserved2
    *
    * @return the reserved2
    */
   public java.lang.String getReserved2() {
      return _reserved2;
   }

   /**
    * Sets the reserved2
    *
    * @param reserved2 the new reserved2 value
    */
   public void setReserved2(java.lang.String reserved2) {
      _reserved2 = reserved2;
   }
   /**
    * Returns the reserved3
    *
    * @return the reserved3
    */
   public java.lang.String getReserved3() {
      return _reserved3;
   }

   /**
    * Sets the reserved3
    *
    * @param reserved3 the new reserved3 value
    */
   public void setReserved3(java.lang.String reserved3) {
      _reserved3 = reserved3;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getPurviewGuid() == null) {
         errors.add("purviewGuid", new ActionError("error.purviewGuid.required"));
      }
      if(getOrgorusrGuid() == null) {
         errors.add("orgorusrGuid", new ActionError("error.orgorusrGuid.required"));
      }
      if(getMsgorcatGuid() == null) {
         errors.add("msgorcatGuid", new ActionError("error.msgorcatGuid.required"));
      }
      // TODO test format/data
      return errors;
   }
}
